# Flags for C pre-processor 
AM_CPPFLAGS=-DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/generic -I/usr/local/include/poisson
 
# Library include directory: This is where all the header files live
OOMPH-LIB_INCLUDE_DIR=/usr/local/include
 
# Library directory: This is where all of oomph-lib's sub-libraries live
OOMPH-LIB_LIB_DIR=/usr/local/lib
 
# These are the external (3rd party) libraries that are distributed
# with oomph-lib and that we always link against
OOMPH-LIB_EXTERNAL_LIBS=-loomph_hsl -loomph_superlu_3.0 -loomph_metis_4.0 -loomph_arpack -loomph_lapack -loomph_flapack -loomph_blas
 
# This specifies where libraries built from third party 
# distributions can be found
EXTERNAL_DIST_LIBRARIES=
 
# This is additional machine-specific linking information that 
# allows mixed-language compilation/linking
FLIBS=-L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6 -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6/../../.. -lmpi_f77 -lmpi -lopen-rte -lopen-pal -ldl -lnsl -lutil -lgfortran -lm -lquadmath -lpthread 
 
# Flags required for the use of shared libraries 
SHARED_LIBRARY_FLAGS=-Wl,--rpath -Wl,/usr/local/lib
 
#---------------------------------------------------------------
# These are the specific oomph-lib sub-libraries that we have to link against
# for this driver code -- edit this according to your requirements
# but remember that the order of the libraries matters: List the
# the more specific ones before the more general ones!
OOMPH-LIB_LIBS=-lpoisson -lgeneric

all: my_demo_code

# Dependencies for this driver code and compile instructions: 
# Which local source (usually *.cc or *.h) files does the
# driver code depend on?
my_demo_code.o: demo_code.cc
	 g++ $(AM_CPPFLAGS) -c demo_code.cc -o my_demo_code.o \
	       -I$(OOMPH-LIB_INCLUDE_DIR) 
  
# Linking instructions: Just declare the target (i.e. the name of the executable)
# and the dependencies (i.e. the object files created above). The rest 
# should not have to be changed. 
my_demo_code: my_demo_code.o
	 g++ $(SHARED_LIBRARY_FLAGS) $< -o $@ \
	       -L$(OOMPH-LIB_LIB_DIR) $(EXTERNAL_DIST_LIBRARIES) $(OOMPH-LIB_LIBS) \
	        $(OOMPH-LIB_EXTERNAL_LIBS) $(FLIBS) 


clean:
	rm -f my_demo_code my_demo_code.o

run: my_demo_code
	./my_demo_code

